<template>
  <div class="zh-door">
    <nav-header></nav-header>
    <div class="zh-door-content">
      <div class="zh-form">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="70px" label-position="top">
          <ul>
            <li>
              <el-form-item label="流媒体id配置" prop="coid">
                <el-input style="width: 360px" v-model="ruleForm.coid" :maxlength="parseInt(15)"
                  placeholder="请输入流媒体id" clearable>
                </el-input>
              </el-form-item>
              <el-form-item>
                <el-button style="minWidth: 80px" size="medium" type="primary" @click.stop="send_door">保存</el-button>
              </el-form-item>
            </li>
          </ul>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        coid: '',
      },
      rules: {
        coid: [
          {
            required: true,
            message: '请输入流媒体id配置',
            trigger: 'blur'
          }
        ]
      }
    };
  },
  created() {
    this.get_door();
  },
  methods: {
    get_door() {
      this.$ajax.get('/api/devicehami/tuimen_config').then((res) => {
        this.ruleForm.coid = res.data.data;
      })
    },
    send_door() {
      this.$ajax.put('/api/devicehami/tuimen_config',this.ruleForm).then((res) => {
        this.$message.success('配置修改成功')
      })
    }

  },
}


</script>
<style lang="scss">
</style>